package timetable;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
import javax.ejb.SessionContext;

import student.Student;
import descriptor.TimetableDescriptor;
/**
 * TimetableBean
 * 
 * 
 * The TimetableBean class implements all the methods that a remote client expect to find
 * when it calls the interface (Timetable).
 * 
 * Note :  -We use @SuppressWarnings("unchecked") to avoid the useless warnings
 */
@SuppressWarnings("unchecked")
public abstract class TimetableBean implements EntityBean 
{
	public abstract int getId();
	public abstract void setId(int id);
	
	public abstract String getName();
	public abstract void setName(String name);
	
	public abstract int getDay();
	public abstract void setDay(int day);
	
	public abstract int getMonth();
	public abstract void setMonth(int month);
	
	public abstract int getYear();
	public abstract void setYear(int year);
	
	public abstract int getHour();
	public abstract void setHour(int hour);
	
	public abstract int getMinute();
	public abstract void setMinute(int minute);
	
	public abstract String getRecruiterName();
	public abstract void setRecruiterName(String recruiterName);
	
	public abstract String getOfferName();
	public abstract void setOfferName(String offerName);
	
	public abstract Student getStudent();
	public abstract void setStudent(Student student);
	
	public String ejbCreate(String name, int day, int month, int year, int hour, int minute,Student student) throws CreateException
    {  	
		setName(name);
		setDay(day);
		setMonth(month);
		setYear(year);
		setHour(hour);
		setMinute(minute);
		return null;
		
    }

    public void ejbPostCreate(String name, int day, int month, int year, int hour, int minute,Student student) throws CreateException
    {
    	setStudent(student);
    	setOfferName(null);
    	setRecruiterName(null);
    }
    
	public TimetableDescriptor getDescriptor()
	{
		return new TimetableDescriptor(getId(),getName(),getDay(),getMonth(),getYear(),getHour(),getMinute(),getStudent().getId(),getRecruiterName(),getOfferName());
	}
   
    public void ejbActivate() throws EJBException, RemoteException {}
	public void ejbPassivate() throws EJBException, RemoteException {}
	public void ejbRemove() throws EJBException, RemoteException,RemoveException {}
	public void setSessionContext(SessionContext arg0) throws EJBException, RemoteException {}
	public void ejbLoad() throws EJBException, RemoteException {}
	public void ejbStore() throws EJBException, RemoteException {}
	public void setEntityContext(EntityContext arg0) throws EJBException, RemoteException {}
	public void unsetEntityContext() throws EJBException, RemoteException {}

}
